﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;

using ZFB.Common;
using ZFB.DTO;

namespace ZFB.IServices
{
    public interface IRoleServices
    {

        /// <summary>
        /// 新增角色
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        Task<ApiResult> AddNewAsync(string roleName);
        /// <summary>
        /// 更新角色
        /// </summary>
        /// <param name="roleId"></param>
        /// <param name="roleName"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateAsync(long roleId, string roleName);
        /// <summary>
        /// 软删除
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        Task<ApiResult> MarkDeletedAsync(long roleId);
        /// <summary>
        /// 根据角色id获取
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ApiResult> GetByIdAsync(long id);
        /// <summary>
        /// 根据角色名字获取
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        Task<ApiResult> GetByNameAsync(string name);
        /// <summary>
        /// 获取全部角色
        /// </summary>
        /// <returns></returns>
        Task<ApiResult> GetAllAsync();
        /// <summary>
        /// 给用户adminuserld 增加角色roleIds
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <param name="roleIds"></param>
        /// <returns></returns>
        Task<ApiResult> AddRoleIdsAsync(long adminUserId, long[] roleIds);
        /// <summary>
        /// 更新角色，先删再加
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <param name="roleIds"></param>
        /// <returns></returns>
        Task<ApiResult> UpdateRoleIdsAsync(long adminUserId, long[] roleIds);
        /// <summary>
        /// 获取用户的角色
        /// </summary>
        /// <param name="adminUserId"></param>
        /// <returns></returns>
        Task<ApiResult> GetByAdminUserIdAsync(long adminUserId);
    }
}
